<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/5/2
  Time: 14:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<%--引入jstl--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--引入springMVC form--%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="page" uri="/xianzhiOA/pageTag" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>编辑工作质量</title>
    <script type="application/javascript">
        function go() {
            if (${quality.qualityId != 0}) {
                document.getElementById("qualityForm").action = "${pageContext.request.contextPath}/Quality/updateQuality.emp";
            }
        }
        function ToempShowPage() {
            window.location.href = "${pageContext.request.contextPath}/Quality/selQualityAll.emp";
        }
    </script>
</head>
<body>
<!--头部开始-->
<jsp:include page="headerBack.jsp"></jsp:include>
<!-- 导航 -->
<jsp:include page="leftBack.jsp"></jsp:include>
<!--内容页-->
<div class="main">
    <!--内容页头部-->
    <div class="page-header">
        <div class="pull-left">
            <ol class="breadcrumb visible-sm visible-md visible-lg">
                <li><a href="${pageContext.request.contextPath}/Login/goHomePage"><i class="icon fa fa-home"></i>主页</a></li>
                <li class="active"><i class="fa fa-pencil"></i>基本信息</li>
            </ol>
        </div>
        <div class="pull-right">
            <h2>主页</h2>
        </div>
    </div>
    <div class="well">
        <sf:form id="qualityForm" action="${pageContext.request.contextPath}/Quality/addQuality.emp" modelAttribute="quality" method="post">
            <sf:input id="moduleId" path="qualityId" type="hidden"/>
            负责人：
            <sf:select path="qualityOfficial">
                <c:forEach var="e" items="${empList}">
                    <c:if test="${e.empId!=userLogin.empId}"><sf:option value="${e.empId}">${e.empName}</sf:option></c:if>
                </c:forEach>
            </sf:select>
            归属项目：
            <sf:select path="qualityProject">
                <sf:options items="${projectList}" itemLabel="projectName" itemValue="projectId"/>
            </sf:select>
            所在周期
            <sf:input path="qualityTime" type="text" cssStyle="width: 100px" class="sang_Calender"/><br/>
            <table class="table" id="now">
                <thead>
                <tr>
                    <th class="vv">bug状态</th>
                    <th class="vv">严重等级</th>
                    <th class="vv">设计</th>
                    <th class="vv">编码</th>
                    <th class="vv">测试</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach begin="0" end="2" var="i">
                    <tr>
                        <c:if test="${i==0}"><td rowspan="3" style="line-height: 100px">缺陷注入</td></c:if>
                        <c:if test="${i==0}"><td>灾难级/严重级</td></c:if>
                        <c:if test="${i==1}"><td>次严重级</td></c:if>
                        <c:if test="${i==2}"><td>一般/其它</td></c:if>
                        <sf:input path="injectList[${i}].injectId" type="hidden"/>
                        <sf:input path="injectList[${i}].injectGrade" type="hidden"/>
                        <sf:input path="injectList[${i}].qualityId" type="hidden"/>
                        <td>
                            <sf:input path="injectList[${i}].injectDesign" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                        <td>
                            <sf:input path="injectList[${i}].injectCode" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                        <td>
                            <sf:input path="injectList[${i}].injectTest" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach begin="0" end="2" var="e">
                    <tr>
                        <c:if test="${e==0}"><td rowspan="3" style="line-height: 100px">缺陷清除</td></c:if>
                        <c:if test="${e==0}"><td>灾难级/严重级</td></c:if>
                        <c:if test="${e==1}"><td>次严重级</td></c:if>
                        <c:if test="${e==2}"><td>一般/其它</td></c:if>
                        <sf:input path="eliminateList[${e}].eliminateId" type="hidden"/>
                        <sf:input path="eliminateList[${e}].eliminateGrade" type="hidden"/>
                        <sf:input path="eliminateList[${e}].qualityId" type="hidden"/>
                        <td>
                            <sf:input path="eliminateList[${e}].eliminateDesign" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                        <td>
                            <sf:input path="eliminateList[${e}].eliminateCode" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                        <td>
                            <sf:input path="eliminateList[${e}].eliminateTest" style="width: 120px" size="3" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <button class="btn btn-primary" onclick="go()" type="submit" style="margin-left: 40px;margin-top: 30px">提交</button>
            <button type="button" onclick="ToempShowPage()" class="btn btn-primary" style="margin-left: 20px;margin-top: 30px">取消</button>
        </sf:form>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/backEnd/js/datetime.js"></script>
</body>
</html>
